-
Notifications
You must be signed in to change notification settings - Fork 917
Restore clipboard history for editor by using ExClipboard instead of directly accessing system clipboard #8462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…rectly accessing system clipboard
|
Test:
Expected result: All words of the sentence of "Licensed to the Apache Software Foundation (ASF)" should be in the clipboard history as individual entries. Observed result: No entry in history Reproduced on: Verified on |
|
this is meant to target delivery, right? |
|
Yes |
mbien
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
makes sense (tested on linux and it populated the clipboard history while copying things from the editor).
Would update the PR title since this is mostly about the history feature and not necessarily windows specific.
|
Updated. Given the history I'm not inclined to do much more on this. |
neilcsmith-net
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks @matthiasblaesing !
Yes, I don't think there's anything more to do. This should hopefully cover the vast majority of cases people expect this to work.
|
making this PR for 26-rc3 |
|
changes here seem to make haven't really looked into it yet |
|
could be harmless, timing changes make a test fail much more often. Copy/paste works, however the test is sometimes failing when it compares the output before the autoimport-on-paste feature finished.
Line 173 in 92eb77d actually: this works only while running a single test case, not the full test edit: NbClipboard itself is asynchronous, the test is assuming copy/paste are blocking operations, see #8476. Essentially the situation as in #8455. |
Which they were. I was curious why returning the copy behaviour to that before #7928 was now causing a test failure. But of course, we're not returning the paste behaviour to the old behaviour, which would have called through NbClipboard::getContents and blocked on the pending change. I think we need some thought about whether it's desirable to keep the NbClipboard asynchronous behaviour? It could just be for content listening with synchronous behaviour? Or we could force syncing the clipboard in the basekit paste action - https://github.com/apache/netbeans/blob/master/ide/editor.lib/src/org/netbeans/editor/BaseKit.java#L2399 ?? Given that and where we are at with NB26, we might consider it safer to pull this and reconsider for NB27? |
I would probably also take the safer option and keep it as is for now. Although I couldn't come up with many scenarios where something would programmatically copy things around similar to the unit tests. |
Restore clipboard history for editor: